<template>
	<view class="j_cont">
		<!-- 收获地址 -->
		<view class="j_address">
			<!-- title -->
			<view class="j_title">头像</view>
			<!-- right -->
			<view class="j_addright">
				<!-- icon图标 -->
				<view class="j_icon">
					<img :src="list.avatar" alt="">
				</view>
				<view class="j_addcont" @click="portrait(list.id)"> > </view>
			</view>
		</view>
		<view class="j_solid"></view>
		<!-- 昵称 -->
		<view class="j_address">
			<!-- title -->
			<view class="j_title">昵称</view>
			<!-- right -->
			<view class="j_addright">
				<view class="j_name">
					{{list.nickname}}
				</view>
				<view class="j_addcont" @click="netname(list.id)"> > </view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {

		data() {
			return {
				id: undefined,
				list:[]
			}
		},
		methods: {
			//头像跳转
			portrait(id){
				uni.navigateTo({
					url:`/pages/person/portrait/portrait?id=${id}`
				})
			},
			//昵称跳转
			netname(id){
				uni.navigateTo({
					url:`/pages/person/netname/netname?id=${id}`
				})
			}
		},
		//获取当前id
		onLoad(option) {
			this.id = option.id
		},
		onShow() {
			//获取当前用户的数据
			this.$api.jsearchMsg({
				id: this.id
			}).then(res => {
				this.list = res.data
			})
		},
	}
</script>

<style lang="scss" scoped>
	
	.j_solid{
		width: 100%;
		height: 2upx;
		background: darkgray;
	}
	.j_cont {
		background: #F2F2F2;
		height: 94vh;
		padding-top: 20upx;
	}

	//收货地址
	.j_address {
		width: 100%;
		height: 80upx;
		background: white;
		padding: 10upx 20upx 10upx 20upx;
		box-sizing: border-box;
		position: relative;
		display: flex;

		.j_name {
			line-height: 60upx;
			margin-right: 20upx;
		}

		//icon图标样式
		.j_icon {
			width: 60upx;
			height: 60upx;
			text-align: center;
			line-height: 80upx;
			margin-right: 20upx;
			border-radius: 50%;
			overflow: hidden;
			img {
				width: 100%;
			}
		}

		//标签内容
		.j_title {
			width: 400upx;
			height: 100%;
			line-height: 60upx;
			font-size: 30upx;
			text-indent: 20upx;
		}

		//开始
		.j_addright {
			width: 100%;
			height: 100%;
			display: flex;
			justify-content: flex-end;

			.j_addcont {
				width: 40upx;
				height: 100%;
				font-size: 40upx;
				text-align: center;
				line-height: 60upx;
			}
		}
	}
</style>
